program horsejump;

var qi:array[1..20,1..20] of shortint;
    m,n:integer;
    x1,y1,x2,y2:integer;
    total:longint;
procedure input;
  var f:text;
  begin
    assign(f,'d:\tq\input.pas');
    reset(f);
    readln(f,m,n);
    readln(f,x1,y1);
    readln(f,x2,y2);
    close(f);
  end;

procedure output;

 begin
   writeln;
   writeln('The total is : ',total);
 end;

function pan(a1,b1:integer):boolean;
 var k:boolean;
 begin
   k:=false;
   if (a1<=m)and(b1<=n)and(a1>0)and(b1>0) then k:=true;
   pan:=k;
 end;

procedure dong;
 var i,j:integer;

 begin
   for i:=1 to 20 do
     for j:=1 to 20 do
       qi[i,j]:=0;
   qi[x2,y2]:=1;

   for i:=m-1 downto 2 do
     for j:=n downto 1 do
        begin
          if pan(i+1,j+2) then qi[i,j]:=qi[i,j]+qi[i+1,j+2];
          if pan(i+1,j-2) then qi[i,j]:=qi[i,j]+qi[i+1,j-2];
          if pan(i+2,j+1) then qi[i,j]:=qi[i,j]+qi[i+2,j+1];
          if pan(i+2,j-1) then qi[i,j]:=qi[i,j]+qi[i+2,j-1];
        end;
   total:=qi[x1+1,y1+2]+qi[x1+1,y1-2]+qi[x1+2,y1+1]+qi[x1+2,y1-1];

 end;

begin
  input;
  total:=0;
  dong;
  output;
end.
















